package com.example.zhunongzonghe.enums;

import lombok.Getter;

@Getter
public enum PostLikeStatusEnum {
    LIKED(1,"点赞"),
    UN_LIKE(0,"未点赞");
    public int code;
    public String desc;

    PostLikeStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static PostLikeStatusEnum getByCode(int code) {
        for (PostLikeStatusEnum postLikeStatusEnum : PostLikeStatusEnum.values()) {
            if (postLikeStatusEnum.code == code) {
                return postLikeStatusEnum;
            }
        }
        return null;
    }
}
